package com.acwing.partition13;

import java.io.*;

/**
 * @author `RKC`
 * @date 2022/2/26 16:01
 */
public class AC1265数星星 {

    private static final int N = 32010;
    private static int[] c = new int[N << 1], cnt = new int[N >> 1];
    private static int n = 0;

    private static final BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
    private static final BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(System.out));

    public static void main(String[] args) throws IOException {
        n = Integer.parseInt(reader.readLine());
        for (int i = 0; i < n; i++) {
            String[] ss = reader.readLine().split(" ");
            int x = Integer.parseInt(ss[0]), y = Integer.parseInt(ss[1]);
            x++;
            cnt[ask(x)]++;
            add(x, 1);
        }
        for (int i = 0; i < n; i++) writer.write(cnt[i] + "\n");
        writer.flush();
    }

    private static void add(int x, int k) {
        for (int i = x; i < N; i += lowbit(i)) c[i] += k;
    }

    private static int ask(int x) {
        int res = 0;
        for (int i = x; i != 0; i -= lowbit(i)) res += c[i];
        return res;
    }

    private static int lowbit(int x) {
        return x & -x;
    }
}
